using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace eBirdAttend
{
    public partial class EBATMain : Form
    {
        Company _CompanyView;
        Branch _BranchView;
        Department _DepartmentView;
        Designation _DesignationView;
        Employee _EmployeeView;
        ShiftDetails _ShiftDetailsView;
        UserDetails _UserDetailsView;
        EmployeeRpt _EmployeeReport; 

        SearchEmployee _SearchEmployee;
        DailyTransactionRpt _DailyTransactionReport;
        AttendanceRpt _AttendanceReport;
        INOUTStatus  _INOUTStatus;
        LatenessReport _LatenessReport;
        DateWiseAttendance _DateWiseAttendance;
        DeviceConfigure _DeviceConfigure;
        EmployeeShift _EmpShift;

        Holidays _Holidays;
        PresenceRpt _PresenceReport;
        AbsenceRpt _AbsenceReport;
        OvertimeRpt _OvertimeReport;
        MonthlyRpt _MonthlyReport;
        LeaveMgt _LeaveMgt;
        LeaveRpt _LeaveReport;
        ReportFwdConfig _ReportFwdConfig;
        SecurityRoundsRpt _SecurityRoundsRpt;

         UserControl _UserControls;

        public EBATMain()
        {
            InitializeComponent();
  
            ////company form settings
            //_CompanyView = new Company();
            //_CompanyView.Location = new System.Drawing.Point(0, 27);
            //_CompanyView.Name = "Company";
            //_CompanyView.Size = new System.Drawing.Size(1050, 700);
            //_CompanyView.TabIndex = 1;
            //_CompanyView.Visible = false;
            //this.Controls.Add(_CompanyView);
            
            //branch form settings
            //_BranchView = new Branch();
            //_BranchView.Location = new System.Drawing.Point(0, 27);
            //_BranchView.Name = "Branch";
            //_BranchView.Size = new System.Drawing.Size (963, 440);
            //_BranchView.TabIndex = 2;
            //_BranchView.Visible = false;
            //this.Controls.Add(_BranchView);

            //department form settings
            //_DepartmentView = new Department();
            //_DepartmentView.Location = new System.Drawing.Point(0, 27);
            //_DepartmentView.Name = "Department";
            //_DepartmentView.Size = new System.Drawing.Size(963, 440);
            //_DepartmentView.TabIndex = 2;
            //_DepartmentView.Visible = false;
            //this.Controls.Add(_DepartmentView);

            //employee form settings
            //_EmployeeView = new Employee();
            //_EmployeeView.Location = new System.Drawing.Point(0, 27);
            //_EmployeeView.Name = "Employee";
            //_EmployeeView.Size = new System.Drawing.Size(963, 999);
            //_EmployeeView.TabIndex = 2;
            //_EmployeeView.Visible = false;
            //this.Controls.Add(_EmployeeView);

            //shift details form settings
            //_ShiftDetailsView = new ShiftDetails();
            //_ShiftDetailsView.Location = new System.Drawing.Point(0, 27);
            //_ShiftDetailsView.Name = "Shift Details";
            //_ShiftDetailsView.Size = new System.Drawing.Size(963, 440);
            //_ShiftDetailsView.TabIndex = 2;
            //_ShiftDetailsView.Visible = false;
            //this.Controls.Add(_ShiftDetailsView);

            //designation form settings
            //_DesignationView = new Designation();
            //_DesignationView.Location = new System.Drawing.Point(0, 27);
            //_DesignationView.Name = "Designation";
            //_DesignationView.Size = new System.Drawing.Size(963, 440);
            //_DesignationView.TabIndex = 2;
            //_DesignationView.Visible = false;
            //this.Controls.Add(_DesignationView);

            //designation form settings
            //_UserDetailsView = new UserDetails();
            //_UserDetailsView.Location = new System.Drawing.Point(0, 27);
            //_UserDetailsView.Name = "User Details";
            //_UserDetailsView.Size = new System.Drawing.Size(963, 440);
            //_UserDetailsView.TabIndex = 2;
            //_UserDetailsView.Visible = false;
            //this.Controls.Add(_UserDetailsView);
        }

        private void EBATMain_Load(object sender, EventArgs e)
        {
            //this is a temp fix for the config loosing problem
            string strConStr1;
            //MessageBox.Show(Properties.Settings.Default["ConnectionString"].ToString());
            strConStr1 = Properties.Settings.Default.ConTmp2.ToString();
            Properties.Settings.Default["ConnectionString"] = strConStr1;
           // MessageBox.Show(Properties.Settings.Default["ConnectionString"].ToString());

           /* Properties.Settings.Default["ConString"] = ConnectionString;
            Properties.Settings.Default["Database"] = cmbDatabase.Text;
            Properties.Settings.Default["DBServer"] = cmbServer.Text;
            Properties.Settings.Default["User"] = txtUser.Text;
            Properties.Settings.Default["PWD"] = txtPwd.Text;
            Properties.Settings.Default["PORT"] = comboBoxSerialPort.Text;
            Properties.Settings.Default["ConnectionString"] = ConnectionString2;
            Properties.Settings.Default.ConTmp1 = ConnectionString;
            Properties.Settings.Default.ConTmp2 = ConnectionString2;
            Properties.Settings.Default.Save(); */
        }


        // Function name   : companyToolStripMenuItem1_Click
        // Description     : 
        // Return type     : void 
        // Author          : Priya Purushothaman
        // Date            : 10/19/2007
        // Modified By     : 
        // Modified On     : 
        // Purpose         : 
        // Argument        : object sender
        // Argument        : EventArgs e
        
        private void companyToolStripMenuItem1_Click(object sender, EventArgs e)
        {
            if (_UserControls != null)
            {
                _UserControls.Dispose();
            }
            _CompanyView = new Company();
            _CompanyView.Location = new System.Drawing.Point(0, 27);
            _CompanyView.Name = "Company";
            _CompanyView.Size = new System.Drawing.Size(1050, 700);
            _CompanyView.TabIndex = 1;
            this.Controls.Add(_CompanyView);
            _CompanyView.Visible = true;
            this.Text = "eOffice --- Company";
            _UserControls = (UserControl)_CompanyView;
        }


        // Function name   : branchToolStripMenuItem_Click
        // Description     : 
        // Return type     : void 
        // Author          : Priya Purushothaman
        // Date            : 10/19/2007
        // Modified By     : 
        // Modified On     : 
        // Purpose         : 
        // Argument        : object sender
        // Argument        : EventArgs e
        
        private void branchToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (_UserControls != null)
            {
                _UserControls.Dispose();
            }
            _BranchView = new Branch();
            _BranchView.Location = new System.Drawing.Point(0, 27);
            _BranchView.Name = "Branch";
            _BranchView.Size = new System.Drawing.Size(1050, 700);
            _BranchView.TabIndex = 2;          
            this.Controls.Add(_BranchView);
            _BranchView.Visible = true;
            this.Text = "eOffice --- Branch";

            _UserControls = (UserControl)_BranchView;
        }


        // Function name   : departmentToolStripMenuItem_Click
        // Description     : 
        // Return type     : void 
        // Author          : Priya Purushothaman
        // Date            : 10/19/2007
        // Modified By     : 
        // Modified On     : 
        // Purpose         : 
        // Argument        : object sender
        // Argument        : EventArgs e
        
        private void departmentToolStripMenuItem_Click(object sender, EventArgs e)
        {
          
            if (_UserControls != null)
            {
                _UserControls.Dispose();
            }
            _DepartmentView = new Department();
            _DepartmentView.Location = new System.Drawing.Point(0, 27);
            _DepartmentView.Name = "Department";
            _DepartmentView.Size = new System.Drawing.Size(1050, 700);
            _DepartmentView.TabIndex = 2;
            this.Controls.Add(_DepartmentView);
            _DepartmentView.Visible = true;
            this.Text = "eOffice --- Department";

            _UserControls = (UserControl)_DepartmentView;
        }


        // Function name   : employeeToolStripMenuItem_Click
        // Description     : 
        // Return type     : void 
        // Author          : Priya Purushothaman
        // Date            : 10/19/2007
        // Modified By     : 
        // Modified On     : 
        // Purpose         : 
        // Argument        : object sender
        // Argument        : EventArgs e
        
        private void employeeToolStripMenuItem_Click(object sender, EventArgs e)
        {

            if (_UserControls != null)
            {
                _UserControls.Dispose();
            }
          
            _EmployeeView = new Employee();
            _EmployeeView.Location = new System.Drawing.Point(0, 27);
            _EmployeeView.Name = "Employee";
            _EmployeeView.Size = new System.Drawing.Size(1050, 700);
            _EmployeeView.TabIndex = 2;
            this.Controls.Add(_EmployeeView);
            _EmployeeView.Visible = true;
            this.Text = "eOffice --- Employee Details";

            _UserControls = (UserControl)_EmployeeView;
        }


        // Function name   : shiftToolStripMenuItem_Click
        // Description     : 
        // Return type     : void 
        // Author          : Priya Purushothaman
        // Date            : 10/19/2007
        // Modified By     : 
        // Modified On     : 
        // Purpose         : 
        // Argument        : object sender
        // Argument        : EventArgs e
        
        private void shiftToolStripMenuItem_Click(object sender, EventArgs e)
        {

            if (_UserControls != null)
            {
                _UserControls.Dispose();
            }
          
            _ShiftDetailsView = new ShiftDetails();
            _ShiftDetailsView.Location = new System.Drawing.Point(0, 27);
            _ShiftDetailsView.Name = "Shift Details";
            _ShiftDetailsView.Size = new System.Drawing.Size(1050, 700);
            _ShiftDetailsView.TabIndex = 2;
            this.Controls.Add(_ShiftDetailsView);
            _ShiftDetailsView.Visible = true;
            this.Text = "eOffice--- Shift Details";

            _UserControls = (UserControl)_ShiftDetailsView;
        }


        // Function name   : designationToolStripMenuItem_Click
        // Description     : 
        // Return type     : void 
        // Author          : Priya Purushothaman
        // Date            : 10/19/2007
        // Modified By     : 
        // Modified On     : 
        // Purpose         : 
        // Argument        : object sender
        // Argument        : EventArgs e
        
        private void designationToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (_UserControls != null)
            {
                _UserControls.Dispose();
            }
          
            _DesignationView = new Designation();
            _DesignationView.Location = new System.Drawing.Point(0, 27);
            _DesignationView.Name = "Designation";
            _DesignationView.Size = new System.Drawing.Size(1050, 700);
            _DesignationView.TabIndex = 2;          
            this.Controls.Add(_DesignationView);
            _DesignationView.Visible = true;
            this.Text = "eOffice --- Designation";

            _UserControls = (UserControl)_DesignationView;
        }


        // Function name   : userToolStripMenuItem_Click
        // Description     : 
        // Return type     : void 
        // Author          : Priya Purushothaman
        // Date            : 10/19/2007
        // Modified By     : 
        // Modified On     : 
        // Purpose         : 
        // Argument        : object sender
        // Argument        : EventArgs e
        
        private void userToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (_UserControls != null)
            {
                _UserControls.Dispose();
            }
          
            _UserDetailsView = new UserDetails();
            _UserDetailsView.Location = new System.Drawing.Point(0, 27);
            _UserDetailsView.Name = "User Details";
            _UserDetailsView.Size = new System.Drawing.Size(1050, 700);
            _UserDetailsView.TabIndex = 2;
            this.Controls.Add(_UserDetailsView);
            _UserDetailsView.Visible = true;
            this.Text = "eOffice --- User Details";

            _UserControls = (UserControl)_UserDetailsView;
        }

        private void empToolStripMenuItem1_Click(object sender, EventArgs e)
        {
            if (_UserControls != null)
            {
                _UserControls.Dispose();
            }
          
            _SearchEmployee = new SearchEmployee();
            _SearchEmployee.Location = new System.Drawing.Point(0, 27);
            _SearchEmployee.Name = "Search An Employee";
            _SearchEmployee.Size = new System.Drawing.Size(1050, 700);
            _SearchEmployee.TabIndex = 2;
            this.Controls.Add(_SearchEmployee);
            _SearchEmployee.Visible = true;
            this.Text = "eOffice --- Search An Employee";

            _UserControls = (UserControl)_SearchEmployee;
        }    

        private void dailyTransactionReportToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (_UserControls != null)
            {
                _UserControls.Dispose();
            }
          
            _DailyTransactionReport = new DailyTransactionRpt();
            _DailyTransactionReport.Location = new System.Drawing.Point(0, 27);
            _DailyTransactionReport.Name = "DailyTransactionReport";
            _DailyTransactionReport.Size = new System.Drawing.Size(1050, 700);
            _DailyTransactionReport.TabIndex = 2;
            this.Controls.Add(_DailyTransactionReport);
            _DailyTransactionReport.Visible = true;
            this.Text = "eOffice --- DailyTransaction Report";
           _UserControls = (UserControl)_DailyTransactionReport;
        }

        private void attendanceReportToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (_UserControls != null)
            {
                _UserControls.Dispose();
            }          
            _AttendanceReport = new AttendanceRpt();
            _AttendanceReport.Location = new System.Drawing.Point(0, 27);
            _AttendanceReport.Name = "AttendanceReport";
            _AttendanceReport.Size = new System.Drawing.Size(1050, 700);
            _AttendanceReport.TabIndex = 2;
            this.Controls.Add(_AttendanceReport);
            _AttendanceReport.Visible = true;
            this.Text = "eOffice --- Attendance Report";

            _UserControls = (UserControl)_AttendanceReport;
        }

        private void iNOUTStatusReportToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (_UserControls != null)
            {
                _UserControls.Dispose();
            }
          
            _INOUTStatus  = new INOUTStatus();
            _INOUTStatus.Location = new System.Drawing.Point(0, 27);
            _INOUTStatus.Name = "In/Out Status Report";
            _INOUTStatus.Size = new System.Drawing.Size(1050, 700);
            _INOUTStatus.TabIndex = 2;
            this.Controls.Add(_INOUTStatus);
            _INOUTStatus.Visible = true;
            this.Text = "eOffice --- In/Out Status Report";
            _UserControls = (UserControl)_INOUTStatus;
        }

        private void latenessReportToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (_UserControls != null)
            {
                _UserControls.Dispose();
            }
          
            _LatenessReport = new LatenessReport();
            _LatenessReport.Location = new System.Drawing.Point(0, 27);
            _LatenessReport.Name = "Lateness Report";
            _LatenessReport.Size = new System.Drawing.Size(1050, 700);
            _LatenessReport.TabIndex = 2;
            this.Controls.Add(_LatenessReport);
            _LatenessReport.Visible = true;
            this.Text = "eOffice --- Lateness Report";
            _UserControls = (UserControl)_LatenessReport;
        }

        private void userSearchToolStripMenuItem_Click(object sender, EventArgs e)
        {

        }

        private void configurationToolStripMenuItem_Click(object sender, EventArgs e)
        {
            ConfigFrm _ConfigFrm = new ConfigFrm();
            _ConfigFrm.ShowDialog();
        }
       

        private void deleteTransactionsToolStripMenuItem_Click(object sender, EventArgs e)
        {
            DeleteTransactionsFrmDevice DelTras = new DeleteTransactionsFrmDevice();
            DelTras.ShowDialog();
        }

        private void holidaysToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (_UserControls != null)
            {
                _UserControls.Dispose();
            }
            _Holidays = new Holidays();
            _Holidays.Location = new System.Drawing.Point(0, 27);
            _Holidays.Name = "Company";
            _Holidays.Size = new System.Drawing.Size(1050, 700);
            _Holidays.TabIndex = 1;
            this.Controls.Add(_Holidays);
            _Holidays.Visible = true;
            this.Text = "eOffice --- Holidays";
            _UserControls = (UserControl)_Holidays;
        }

        //private void SetDeviceTime_Click(object sender, EventArgs e)
        //{
            //String strPort = Properties.Settings.Default.PORT.ToString();
            //string strCmdBuffer;
            //string strReply="";
            //eOfficeTrans DeviceCon = new eOfficeTrans();
            //DeviceCon.OpenPort(strPort);
            //DeviceCon.Init();

            //if (MessageBox.Show("Do you want to sync the device time with host pc time", "Time Update", MessageBoxButtons.YesNo,MessageBoxIcon.Question) == DialogResult.Yes)
            //{
            //    int iYear = DateTime.Now.Year;
            //    iYear = iYear % 1000;
            //    strCmdBuffer = "TS ";
            //    strCmdBuffer = strCmdBuffer + iYear.ToString();
            //    strCmdBuffer = strCmdBuffer + "," + DateTime.Now.Month.ToString();
            //    strCmdBuffer = strCmdBuffer + "," + DateTime.Now.Day.ToString();
            //    strCmdBuffer = strCmdBuffer + "," + DateTime.Now.Hour.ToString();
            //    strCmdBuffer = strCmdBuffer + "," + DateTime.Now.Minute.ToString();
            //    strCmdBuffer = strCmdBuffer + "," + DateTime.Now.Second.ToString();
            //    strCmdBuffer = strCmdBuffer + "\r";
            //    //MessageBox.Show(strCmdBuffer);
            //    if (DeviceCon.SendCommand(strCmdBuffer, ref strReply) == 1)
            //        MessageBox.Show("Time updated successfully", "Time Update", MessageBoxButtons.OK, MessageBoxIcon.Information);
            //    else MessageBox.Show("Error " + strReply, "Time Update", MessageBoxButtons.OK, MessageBoxIcon.Error);
            //}           
        //}

        private void quitToolStripMenuItem_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void presenceReportToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (_UserControls != null)
            {
                _UserControls.Dispose();
            }

            _PresenceReport = new PresenceRpt();
            _PresenceReport.Location = new System.Drawing.Point(0, 27);
            _PresenceReport.Name = "Presence Report";
            _PresenceReport.Size = new System.Drawing.Size(1050, 700);
            _PresenceReport.TabIndex = 2;
            this.Controls.Add(_PresenceReport);
            _PresenceReport.Visible = true;
            this.Text = "eOffice --- Presence Report";
            _UserControls = (UserControl)_PresenceReport;
        }

        private void absenceReportToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (_UserControls != null)
            {
                _UserControls.Dispose();
            }

            _AbsenceReport = new AbsenceRpt();
            _AbsenceReport.Location = new System.Drawing.Point(0, 27);
            _AbsenceReport.Name = "Absence Report";
            _AbsenceReport.Size = new System.Drawing.Size(1050, 700);
            _AbsenceReport.TabIndex = 2;
            this.Controls.Add(_AbsenceReport);
            _AbsenceReport.Visible = true;
            this.Text = "eOffice --- Absence Report";
            _UserControls = (UserControl)_AbsenceReport;
        }

        private void overtimeReportToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (_UserControls != null)
            {
                _UserControls.Dispose();
            }

            _OvertimeReport = new OvertimeRpt();
            _OvertimeReport.Location = new System.Drawing.Point(0, 27);
            _OvertimeReport.Name = "Over Time Report";
            _OvertimeReport.Size = new System.Drawing.Size(1050, 700);
            _OvertimeReport.TabIndex = 2;
            this.Controls.Add(_OvertimeReport);
            _OvertimeReport.Visible = true;
            this.Text = "eOffice --- Over Time Report";
            _UserControls = (UserControl)_OvertimeReport;
        }

        private void dateWiseAttendanceToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (_UserControls != null)
            {
                _UserControls.Dispose();
            }
            _DateWiseAttendance = new DateWiseAttendance();
            _DateWiseAttendance.Location = new System.Drawing.Point(0, 27);
            _DateWiseAttendance.Name = "DateWiseAttendance";
            _DateWiseAttendance.Size = new System.Drawing.Size(1050, 700);
            _DateWiseAttendance.TabIndex = 1;
            this.Controls.Add(_DateWiseAttendance);
            _DateWiseAttendance.Visible = true;
            this.Text = "eOffice --- Date Wise Attendance";
            _UserControls = (UserControl)_DateWiseAttendance;
        }

        private void deviceSeToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (_UserControls != null)
            {
                _UserControls.Dispose();
            }
            _DeviceConfigure = new DeviceConfigure();
            _DeviceConfigure.Location = new System.Drawing.Point(0, 27);
            _DeviceConfigure.Name = "DeviceConfigure";
            _DeviceConfigure.Size = new System.Drawing.Size(1050, 700);
            _DeviceConfigure.TabIndex = 1;
            this.Controls.Add(_DeviceConfigure);
            _DeviceConfigure.Visible = true;
            this.Text = "eOffice --- Device Configure";
            _UserControls = (UserControl)_DeviceConfigure;
        }       

        private void EBATMain_FormClosing(object sender, FormClosingEventArgs e)
        {
            DialogResult _dlg = MessageBox.Show("Are you sure you want to exit?", "Warning", MessageBoxButtons.YesNo);
            if (_dlg == DialogResult.No)
                e.Cancel = true;
            else
                e.Cancel = false;

        }

        private void userImportToolStripMenuItem_Click(object sender, EventArgs e)
        {
            try
            {
                System.Diagnostics.Process.Start("ImportUtility.exe");
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message.ToString());
            }
        }

        private void shiftScheduleToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (_UserControls != null)
            {
                _UserControls.Dispose();
            }
            _EmpShift = new EmployeeShift();
            _EmpShift.Location = new System.Drawing.Point(0, 27);
            _EmpShift.Name = "ShiftSchedule";
            _EmpShift.Size = new System.Drawing.Size(1050, 700);
            _EmpShift.TabIndex = 1;
            this.Controls.Add(_EmpShift);
            _EmpShift.Visible = true;
            this.Text = "eOffice --- Shift Schedule";
            _UserControls = (UserControl)_EmpShift;
            
        }

        private void leaveManagementToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (_UserControls != null)
            {
                _UserControls.Dispose();
            }
            _LeaveMgt = new LeaveMgt();
            _LeaveMgt.Location = new System.Drawing.Point(0, 27);
            _LeaveMgt.Name = "Leave Management";
            _LeaveMgt.Size = new System.Drawing.Size(1050, 700);
            _LeaveMgt.TabIndex = 1;
            this.Controls.Add(_LeaveMgt);
            _LeaveMgt.Visible = true;
            this.Text = "eOffice --- Leave Management";
            _UserControls = (UserControl)_LeaveMgt;
        }

        private void leaveReportToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (_UserControls != null)
            {
                _UserControls.Dispose();
            }
            _LeaveReport = new LeaveRpt();
            _LeaveReport.Location = new System.Drawing.Point(0, 27);
            _LeaveReport.Name = "Leave Report";
            _LeaveReport.Size = new System.Drawing.Size(1050, 700);
            _LeaveReport.TabIndex = 1;
            this.Controls.Add(_LeaveReport);
            _LeaveReport.Visible = true;
            this.Text = "eOffice --- Leave Report";
            _UserControls = (UserControl)_LeaveReport;
        }

        private void reportForwardConfigToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (_UserControls != null)
            {
                _UserControls.Dispose();
            }
            _ReportFwdConfig = new ReportFwdConfig();
            _ReportFwdConfig.Location = new System.Drawing.Point(0, 27);
            _ReportFwdConfig.Name = "Report Forward";
            _ReportFwdConfig.Size = new System.Drawing.Size(1050, 700);
            _ReportFwdConfig.TabIndex = 1;
            this.Controls.Add(_ReportFwdConfig);
            _ReportFwdConfig.Visible = true;
            this.Text = "eOffice --- Report Forward Configuration";
            _UserControls = (UserControl)_ReportFwdConfig;
        }

        private void employeeWiseReportToolStripMenuItem_Click(object sender, EventArgs e)
        {

            if (_UserControls != null)
            {
                _UserControls.Dispose();
            }
            _EmployeeReport = new EmployeeRpt();
            _EmployeeReport.Location = new System.Drawing.Point(0, 27);
            _EmployeeReport.Name = "AttendanceReport";
            _EmployeeReport.Size = new System.Drawing.Size(1050, 700);
            _EmployeeReport.TabIndex = 2;
            this.Controls.Add(_EmployeeReport);
            _EmployeeReport.Visible = true;
            this.Text = "eOffice --- Attendance Report";
            _UserControls = (UserControl)_EmployeeReport;
        }

        private void securityRoundsReportToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (_UserControls != null)
            {
                _UserControls.Dispose();
            }
            _SecurityRoundsRpt = new SecurityRoundsRpt();
            _SecurityRoundsRpt.Location = new System.Drawing.Point(0, 27);
            _SecurityRoundsRpt.Name = "SecurityRoundsReport";
            _SecurityRoundsRpt.Size = new System.Drawing.Size(1050, 700);
            _SecurityRoundsRpt.TabIndex = 1;
            this.Controls.Add(_SecurityRoundsRpt);
            _SecurityRoundsRpt.Visible = true;
            this.Text = "eOffice --- Security Rounds Report";
            _UserControls = (UserControl)_SecurityRoundsRpt;

            //_MonthlyReport = new MonthlyRpt();
            //_MonthlyReport.Location = new System.Drawing.Point(0, 27);
            //_MonthlyReport.Name = "MonthlyReport";
            //_MonthlyReport.Size = new System.Drawing.Size(1050, 700);
            //_MonthlyReport.TabIndex = 1;
            //this.Controls.Add(_MonthlyReport);
            //_MonthlyReport.Visible = true;
            //this.Text = "eOffice --- Monthly Report";
            //_UserControls = (UserControl)_MonthlyReport;


        }

        private void secuToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (_UserControls != null)
            {
                _UserControls.Dispose();
            }
            _SecurityRoundsRpt = new SecurityRoundsRpt();
            _SecurityRoundsRpt.Location = new System.Drawing.Point(0, 27);
            _SecurityRoundsRpt.Name = "SecurityRoundsReport";
            _SecurityRoundsRpt.Size = new System.Drawing.Size(1050, 700);
            _SecurityRoundsRpt.TabIndex = 1;
            this.Controls.Add(_SecurityRoundsRpt);
            _SecurityRoundsRpt.Visible = true;
            this.Text = "eOffice --- Security Rounds Report";
            _UserControls = (UserControl)_SecurityRoundsRpt;
        }

   

        


        

        
    }
}